//引入数据库模块
var mysql = require('mysql');

var con = mysql.createConnection({
    host:"localhost",
    port:3306,
    user:'root',
    password:"",
    database:'cyw'
})
var userName = process.argv[2];
var age = process.argv[3];
var sex = process.argv[4];

var insertSql = "insert into users values(?, ?, ?, ?)";
var primarykey = (new Date()).getTime();
con.query(insertSql,[primarykey,userName,age,sex],(err,result) => {
    if(err){
        console.log(err);
    }
    else{
        console.log(result);
    }
})
